package com.sskj.gocoin.p.activity;

import com.lzy.okgo.OkGo;
import com.lzy.okgo.model.Response;
import com.sskj.gocoin.m.HttpConfig;
import com.sskj.gocoin.m.bean.HttpData;
import com.sskj.gocoin.m.http.JsonCallBack;
import com.sskj.gocoin.p.base.BasePresenter;
import com.sskj.gocoin.utils.ToastUtil;
import com.sskj.gocoin.v.activity.VerifyJuniorActivity;

/**
 * <pre>
 *     author : wk_math
 *     e-mail : wk_math@163.com
 *     time   : 2018/03/30
 *     desc   :
 *     version: 1.0
 * </pre>
 */

public class VerifyJuniorPresenter extends BasePresenter<VerifyJuniorActivity> {

    public void verifyJunior(String realname, String idcard) {
        OkGo.<HttpData<String>>post(HttpConfig.BASE_URL + HttpConfig.VERIFY_JUNIOR)
                .params("name", realname)
                .params("card_id", idcard)
                .execute(new JsonCallBack<HttpData<String>>(this) {
                    @Override
                    protected void _onSuccess(Response<HttpData<String>> response) {
                        if (response.body().getCode() == 200) {
                            ToastUtil.showShort(response.body().msg);
                            mView.updateSuccess();
                        }
                    }
                });
    }
//    public void verifyJunior(String mobile, String eamil, String cardNum, String realName, int type) {
//        OkGo.<HttpData<String>>post(HttpConfig.BASE_URL + HttpConfig.VERIFY_JUNIOR)
//                .params("mobile", mobile)
//                .params("email", eamil)
//                .params("card_num", cardNum)
//                .params("realname", realName)
//                .params("type", type)
//                .execute(new JsonCallBack<HttpData<String>>(this) {
//                    @Override
//                    protected void _onSuccess(Response<HttpData<String>> response) {
//                        if (response.body().getCode() == 200) {
//                            ToastUtil.showShort(response.body().msg);
//                            mView.updateSuccess();
//                        }
//                    }
//                });
//    }
}
